package com.chuangmei.com.arindoorlocationsystem.config.adapter;


import android.content.Context;

import com.chuangmei.com.arindoorlocationsystem.R;
import com.chuangmei.com.arindoorlocationsystem.base.adapter.BaseRecyclerViewAdapter;
import com.chuangmei.com.arindoorlocationsystem.base.adapter.BaseRecyclerViewHolder;
import com.chuangmei.com.arindoorlocationsystem.bean.MapItem;
import com.chuangmei.com.arindoorlocationsystem.utils.Constant;

import java.util.List;

/**
 * 项目名称：ARIndoorLocationSystem
 * 类描述：配置页面RecyclerViewAdapter
 * 创建人：LuoHao
 * 创建时间：2018/4/8 11:09
 * 修改人：LuoHao
 * 修改时间：2018/4/8 11:09
 * 修改备注：
 */

public class ConfigAdapter extends BaseRecyclerViewAdapter<MapItem> {

    private  Context context;

    public ConfigAdapter(Context context, int layoutId, List<MapItem> list) {
        super(layoutId, list);
        this.context = context;
    }

    @Override
    protected void notifyData(List<MapItem> list) {
        super.notifyData(list);
    }

    @Override
    protected void convert(BaseRecyclerViewHolder holder, MapItem itemMessage) {
        if (itemMessage.getTitle().contains(context.getResources().getString(Constant.configItemName[2]))) {
            holder.setText(R.id.mTV_item_name, itemMessage.getTitle()).setText(R.id.mTV_item_cache_message,
                    itemMessage.getValue());
        } else {
            holder.setText(R.id.mTV_item_name, itemMessage.getTitle()).setImageResource(R.id.mTV_item_lcon, R.mipmap
                    .config_item_right);
        }
    }
}
